package com.example.book.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.book.service.IFinishService;
import com.example.book.service.IRecommendService;
import com.example.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/recommend")
@Api(tags = "推荐图书控制器")
public class RecommendController {
    @Autowired
    private IRecommendService recommendService;
    /**
     * 查询图书类型
     *
     * @param page
     * @param pageSize
     * @param name
     * @return
     */
    @ApiOperation(value = "查询图书类型")
    @GetMapping("/page")
    public ResponseResult<Page> pageInfo(Integer page, Integer pageSize, String name){
        return recommendService.pageInfo(page, pageSize, name);
    }



    /**
     * 删除
     * @param ids
     * @return
     */
    @DeleteMapping
    public ResponseResult deleteRecommend(int[] ids) {
        recommendService.deleteRecommend(ids);
        return ResponseResult.okResult("图书推荐删除成功");
    }
}
